using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblDuAnUI
{ 
	private int idDuAn;
	public int IdDuAn
	{
		get { return idDuAn;}
		set { idDuAn = value;}
	}

	private int idChuyenGia;
	public int IdChuyenGia
	{
		get { return idChuyenGia;}
		set { idChuyenGia = value;}
	}

	private String tenDuAn;
	public String TenDuAn
	{
		get { return tenDuAn;}
		set { tenDuAn = value;}
	}

	private String diaDiem;
	public String DiaDiem
	{
		get { return diaDiem;}
		set { diaDiem = value;}
	}

	private DateTime tuThoiGian;
	public DateTime TuThoiGian
	{
		get { return tuThoiGian;}
		set { tuThoiGian = value;}
	}

	private DateTime denThoiGian;
	public DateTime DenThoiGian
	{
		get { return denThoiGian;}
		set { denThoiGian = value;}
	}

	private String noiDungDuAn;
	public String NoiDungDuAn
	{
		get { return noiDungDuAn;}
		set { noiDungDuAn = value;}
	}

	private String coQuan;
	public String CoQuan
	{
		get { return coQuan;}
		set { coQuan = value;}
	}

	private String viTri;
	public String ViTri
	{
		get { return viTri;}
		set { viTri = value;}
	}

	private int tongThoiGian;
	public int TongThoiGian
	{
		get { return tongThoiGian;}
		set { tongThoiGian = value;}
	}

	private String congViec;
	public String CongViec
	{
		get { return congViec;}
		set { congViec = value;}
	}

	public tblDuAnUI() {}

	public tblDuAnUI(int idDuAn, int idChuyenGia, String tenDuAn, String diaDiem, DateTime tuThoiGian, DateTime denThoiGian, String noiDungDuAn, String coQuan, String viTri, int tongThoiGian, String congViec)
	 {
		this.idDuAn = idDuAn;
 		this.idChuyenGia = idChuyenGia;
 		this.tenDuAn = tenDuAn;
 		this.diaDiem = diaDiem;
 		this.tuThoiGian = tuThoiGian;
 		this.denThoiGian = denThoiGian;
 		this.noiDungDuAn = noiDungDuAn;
 		this.coQuan = coQuan;
 		this.viTri = viTri;
 		this.tongThoiGian = tongThoiGian;
 		this.congViec = congViec;
 	}

	public int Add(int idChuyenGia, String tenDuAn, String diaDiem, DateTime tuThoiGian, DateTime denThoiGian, String noiDungDuAn, String coQuan, String viTri, int tongThoiGian, String congViec)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblDuAn_Add",idChuyenGia,tenDuAn,diaDiem,tuThoiGian,denThoiGian,noiDungDuAn,coQuan,viTri,tongThoiGian,congViec);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idDuAn, int idChuyenGia, String tenDuAn, String diaDiem, DateTime tuThoiGian, DateTime denThoiGian, String noiDungDuAn, String coQuan, String viTri, int tongThoiGian, String congViec)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblDuAn_Update",idDuAn,idChuyenGia,tenDuAn,diaDiem,tuThoiGian,denThoiGian,noiDungDuAn,coQuan,viTri,tongThoiGian,congViec);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idDuAn)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblDuAn_Delete",idDuAn);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblDuAn_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idDuAn)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblDuAn_Get",idDuAn);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblDuAn_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdChuyenGia(int idChuyenGia)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblDuAn_GetByIdChuyenGia",idChuyenGia);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
